package com.njbdqn.myshops.model.mapper;

import com.njbdqn.myshops.pojo.Goods;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface GoodsMapper {
    @Select("select * from goods limit ${(page-1)*20},20")
    List<Goods> findCurrentData(int page);

    @Select("select ceil(count(*)/20) cp from goods")
    int getTotal();

    @Select("select * from goods where good_id=#{good_id}")
    Goods findById(int good_id);
}
